<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const aaa=function(){

        }
        //对象字面量中定义函数
        const obj={
            bbb:function(){

            },
            ccc:function(){

            }
        }
        // es6中定义箭头函数
        const ccc=()=>{

        }

        const dddd=(a,b)=>{
            return a+b
        }
        const power=(a)=>{
            return a*a
        }
        //函数代码块中有多行代码时候
        const test=()=>{
            console.log('hello world')
            console.log('hello world1')
            console.log('hello world2')

        }
        //函数代码块中只有一行代码
        const mul =(num1,num2)=>{
            return num1+num2
        }
        //只有一行代码可以这么写
        const mu2 =(num1,num2)=>num1+num2
        console.log(mu2(1,2))

        const demo=()=>console.log('hello demo')
        console.log(demo())
    </script>
</body>
</html>